package cn.dengta.webapp.trade.model;

import javax.annotation.Nullable;

import cn.dengta.common.model.ValueProxy;
import cn.dengta.common.model.ValueProxyImpl;
import cn.dengta.common.util.Common;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

@Getter
public enum ScenesType implements ValueProxyImpl<ScenesType, Integer> {
	GUIDE_GIFT(1, "礼物引导"),
	GUIDE_VIDEO(2, "视频引导"),
	ACTIVITY(3, "活动充值"),
	GAME(4, "游戏充值"),
	GUIDE_LIVE(5, "直播礼物引导"),
	;

	@EnumValue
	public final Integer value;
	final String label;
	final ValueProxy<ScenesType, Integer> proxy;

	// 构造函数，枚举类型只能为私有
	ScenesType(Integer value, String label) {
		this.value = value;
		this.label = label;
		this.proxy = new ValueProxy<>(this, value, label);
	}

	public static final ScenesType[] CACHE = values();

	public static ScenesType of(@Nullable Integer value) {
		return Common.getEnum(CACHE, ScenesType::getValue, value);
	}
}
